package com.wuseguang.springcloud.service;


import com.wuseguang.springcloud.client.ServiceList;
import com.wuseguang.springcloud.service.impl.DeptClientServiceFallbackFactory;
import com.wuseguang.springcloud.util.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;


@FeignClient(value = ServiceList.MICROSERVICECLOUD_DEPT, fallbackFactory = DeptClientServiceFallbackFactory.class)
public interface DeptClientService {

    @RequestMapping(value = "/tlogin")
    Result tlogin(@RequestParam("phone") String phone,
                  @RequestParam("pwd") String pwd,
                  @RequestParam(value = "type", defaultValue = "0") Integer type,
                  @RequestParam(value = "code", required = false) String code);

    @RequestMapping(value = "/plogin")
    Result plogin(@RequestParam("phone") String phone,
                  @RequestParam("pwd") String pwd,
                  @RequestParam(value = "type", defaultValue = "0") Integer type,
                  @RequestParam(value = "code", required = false) String code);

    @RequestMapping("/alogin")
    Result alogin(@RequestParam("phone") String phone,
                  @RequestParam("pwd") String pwd);

    @RequestMapping("/getOfficialAccountOpenId")
    Result getOfficialAccountOpenId(@RequestParam(value = "code") String code,
                                    @RequestParam(value = "type") Integer type);
}
